#include<bits/stdc++.h>

using i32 = signed;
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;

int main() {
	
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	i64 n, m;
	std::cin >> n >> m;
	std::vector<int> a(n);
	std::map<int, int> mp;
	for(int i = 0; i < n; i++) {
		std::cin >> a[i];
		mp[a[i]]++;
	}

	auto check = [&](i64 x) -> bool {
		i64 t = 0;
		for(auto [f, s] : mp) {
			t += 1LL * std::min(1LL * f, x) * s;
		}
		if(t > m) {
			return false;
		}
		return true;
	};
	i64 l = 0, r = 2E14 + 5;
	i64 ans = 0;
	while(l <= r) {
		i64 mid = l + r >> 1;
		if(check(mid)) {
			ans = mid;
			l = mid + 1;
		}else {
			r = mid - 1;
		}
	}
	if(ans == 2E14 + 5) {
		std::cout << "infinite";
	}else {
		std::cout << ans;
	}
	return 0;
}